import javax.microedition.lcdui.Choice;
import javax.microedition.lcdui.Command;
import javax.microedition.lcdui.CommandListener;
import javax.microedition.lcdui.Display;
import javax.microedition.lcdui.Displayable;
import javax.microedition.lcdui.Form;
import javax.microedition.lcdui.List;
import javax.microedition.lcdui.Screen;
import javax.microedition.midlet.MIDlet;

public class MIDletClient extends MIDlet implements CommandListener {

   private static Display display;
   private Form forma;
   private Communicator trafficClient;
   public boolean color;
   
   private Command exitCommand = new Command("Izlaz", Command.EXIT, 1);
   private Command startCommand = new Command("Salji SMS", Command.ITEM, 1);
   
   public MIDletClient() {
	   display = Display.getDisplay(this); 
	   color = display.isColor();
	   forma = new Form("SMS Parking");
   } 
   public void startApp() {    
	   forma.addCommand(startCommand);
	   forma.addCommand(exitCommand);
	   forma.setCommandListener(this); 
	   display.setCurrent(forma);
   }

   public void pauseApp() {
   }

   public void destroyApp(boolean unconditional) {
   }

   
   public void commandAction(Command c, Displayable d) {
    
	   if (c == exitCommand) {
		   destroyApp(false);
		   notifyDestroyed();
	   }
    
	   if (c == startCommand) {
		   trafficClient = new Communicator(this);
		   trafficClient.start();
    		}
    }


}

